﻿// See https://aka.ms/new-console-template for more information
Console.WriteLine("Hello, World!");
int i = 0;

using (AdvancedTimer.Timer timer = new(ElapsedMilliseconds: 1))
{

    timer.TimerElapsed += () =>
    {
        Console.WriteLine(DateTime.Now.ToString($"{++i}   yyyy-MM-dd HH:mm:ss.fff"));
    };
    timer.Start();


    Console.ReadKey();

    timer.Stop();

    Console.ReadKey();

    timer.Start();
}

//Console.WriteLine("Timer Stopped");
//Console.ReadKey();

//System.Timers.Timer timer1 = new(1);
//timer1.Elapsed += (sender, e) =>
//{
//    Console.WriteLine(DateTime.Now.ToString($"{++i}   yyyy-MM-dd HH:mm:ss.fff"));
//};
//timer1.Start();
////timer1.Dispose();

Console.ReadKey();